import request from '@/utils/request'

// 给角色分配权限
export function assignPrem(data) {
  return request({
    method: 'put',
    url: '/sys/role/assignPrem',
    data
  })
}

// 获取角色权限
export function getRoleInfoById(id) {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}

// 修改权限
export function editPermission(id, data) {
  return request({
    method: 'put',
    url: `/sys/permission/${id}`,
    data
  })
}

// 查看权限
export function LookPermission(id) {
  return request({
    method: 'get',
    url: `/sys/permission/${id}`

  })
}

// 添加权限
export function addPermission(data) {
  return request({
    method: 'post',
    url: '/sys/permission',
    data
  })
}

//  获取权限列表
export function getPermissionList() {
  return request({
    url: '/sys/permission'
  })
}

// 删除权限
export function delPermission(id) {
  return request({
    method: 'delete',
    url: `/sys/permission/${id}`
  })
}
